#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,m,len1,len2;
char S[N],T[N];
vector<int>s,t;
bool check_B(){
	for(int i=0;i<len2;i++)
		if(t[i]!=1)return 0;
	return 1;
}
void sol_B(){
	if(S[1]==T[1]){
		if(len1==len2){
			cout<<"YES\n";
			for(int i=0,now=0;i<len1;i++){
				cout<<now+1<<' ';
				now+=s[i];
			}
		}else if(len1-1==len2){
			cout<<"Yes\n";
			for(int i=0,now=0;i<len2;i++){
				now+=s[i];
				cout<<now<<' ';
			}
		}else{
			cout<<"NO\n";
		}
	}else{
		if(len1-1==len2){
			cout<<"YES\n";
			for(int i=1,now=s[0];i<len1;i++){
				cout<<now+1<<' ';
				now+=s[i];
			}
		}else if(len1-2==len2){
			int flag=0;
			for(int i=1;i+1<len1;i++)if(s[i]==1)flag=1;
			if(!flag){
				cout<<"NO\n";
			}else{
				cout<<"YES\n";
				flag=0;
				for(int i=1,now=0;i+1<len1;i++){
					if(flag)now+=s[i];
					else now+=s[i-1];
					if(flag)cout<<now<<' ';
					else cout<<now+1<<' ';
					if(flag==0&&s[i]==1){
						flag=1;
						now+=s[i];
					}
				}
			}
		}else{
			cout<<"NO\n";
		}
	}
	return;
}
int pre[N];
vector<vector<int>>q;
int l[N],r[N];
vector<vector<bool>>f;
vector<vector<int>>g;
void OUT(int x,int y){
	if(!y)return;
	OUT(g[x][y],y-1);
	cout<<x<<' ';
}
signed main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	cin>>S+1>>T+1;
	n=strlen(S+1),m=strlen(T+1);
	if(1ll*n*m<=1e8){
		for(int i=1;i<=n;i++)
			if(S[i-1]!=S[i])pre[i]=i;
			else pre[i]=pre[i-1];
		q.resize(m+5);
		for(int i=1;i<=m;i++)q[i].resize(n+5);
		f.resize(n+5);
		for(int i=1;i<=n;i++)f[i].resize(m+5);
		g.resize(n+5);
		for(int i=1;i<=n;i++)g[i].resize(m+5);
		for(int i=1;i<=m;i++)l[i]=1;
		q[1][++r[1]]=1;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++){
				while(l[j]<=r[j]&&q[j][l[j]]<pre[i-1])l[j]++;
				if(S[i]==T[j]&&l[j]<=r[j])f[i][j]=1,g[i][j]=q[j][l[j]]-1;
			}
			for(int j=1;j<m;j++)
				if(f[i][j])q[j+1][++r[j+1]]=i+1;
		}
		for(int j=n;j>=1;j--){
			if(f[j][m]){cout<<"YES\n";OUT(j,m);return 0;}
			if(S[j]!=S[n])break;
		}
		cout<<"NO\n";
		return 0; 
	}
	len1=1,s.push_back(1);
	for(int i=2;i<=n;i++){
		if(S[i]==S[i-1])s[len1-1]++;
		else s.push_back(1),len1++;
	}
	len2=1,t.push_back(1);
	for(int i=2;i<=m;i++){
		if(T[i]==T[i-1])t[len2-1]++;
		else t.push_back(1),len2++;
	}
	if(check_B()){
		sol_B();
		return 0;
	}
	return 0;
}/*
11101110111011101110111
00000
*/
